package com.ruoyi.common.enums;

/**
 * 金额类型
 */
public enum AmountType {
	/**
	 * CNN
	 */
	CNN(1, "CNN余额"),
	/**
	 * VC
	 */
	VC(2, "VC余额"),
	/**
	 * VC_WITHDRAW
	 */
	VC_WITHDRAW(3, "VC理财资产"),
	/**
	 * VC_CONSUME
	 */
	VC_CONSUME(4, "VC消费资产"),

	/**
	 * CNN可提资产
	 */
	CNN_WITHDRAW(5, "CNN可提资产"),

	/***
	 * USDT
	 */
	USDT(6, "USDT"),

	/***
	 * ETH
	 */
	ETH(7, "ETH"),

	/**
	 * VC_FUND
	 */
	VC_FUND(8, "VC基金资产"),
	;

	AmountType(int code, String name) {
		this.code = code;
		this.name = name;
	}

	private int code;
	private String name;

	public int getCode() {
		return this.code;
	}

	public String getName() {
		return this.name;
	}

	public static AmountType getByCode(int code) {
		AmountType[] array = AmountType.values();
		AmountType temp = null;
		for (int i = 0; i < array.length; i++) {
			temp = array[i];
			if (code == temp.getCode()) {
				return temp;
			}
		}
		return null;
	}
}
